package com.nuc.zyt.day04.Threadpool;

import com.nuc.zyt.day04.multiprocessing.Thread1;

import java.lang.reflect.Executable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ClassName ThreadPool
 * @Description TODO
 * @Author 耀酱
 * @Date 2023/5/30 16:43
 * @Version 1.0
 */

public class ThreadPool {
    public static void main(String[] args) {
        // 自带的池子工具类
        ExecutorService executorService = Executors.newCachedThreadPool(); // 没有上限

        ExecutorService executorService1 = Executors.newFixedThreadPool(3); // 上限为3

        executorService.submit(new Thread1());

    }
}
